<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="primus" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="fn" tagdir="/WEB-INF/tags/form" %>
<primus:page title="门店申请改派订单列表">
    <jsp:attribute name="css">
        <style type="text/css">
            #table .operate {
                min-width: 80px;
            }
        </style>
    </jsp:attribute>
    <jsp:attribute name="script">
        <script type="application/javascript">
            $(function () {
                $("#table").DataTable({
                    "lengthMenu": [[10, 20, 50, -1], [10, 20, 50, "所有"]],
                    "columnDefs": [{"targets": [7], "orderable": false}],
                    "searching": false,
                    "order": [[0, "asc"]]
                });
            });
            $("body").on("click", ".geo-line", function () {
                var id = $(this).data("id");
            })
        </script>
    </jsp:attribute>
    <jsp:body>
        <div class="breadcrumbs ace-save-state" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="welcome.do">
                        首页
                    </a>
                </li>
                <li>
                    <a href="geo/provinces">
                        订单管理
                    </a>
                </li>
                <li class="active">
                    门店申请改派订单列表
                </li>
            </ul>
        </div>

        <div class="page-content">

            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                        <div class="col-xs-12">
                            <h3 class="header smaller lighter blue">
                                门店申请改派
                            </h3>
                            <div class="row">
                                <div style="float:right">
                                    <button class="btn btn-white btn-default btn-round backButton">
                                        <i class="ace-icon fa fa-reply icon-only" style="padding:0;margin:0;float:left;box-sizing:border-box;"></i>
                                        返回
                                    </button>
                                    <button class="btn btn-white btn-default btn-round" id="closeButton">
                                        <i class="ace-icon fa fa-times red2" style="padding:0;margin:0;float:left;box-sizing:border-box;"></i>
                                        关闭
                                    </button>
                                </div>
                                <h4 class="header smaller lighter blue">
                                    收货信息变更
                                </h4>
                                <div class="row">
                                    <div style="float:right">
                                        <button class="btn btn-sm btn-warning" id="updateButton">
                                            <i class="ace-icon"></i>
                                            <span class="bigger-110 no-text-shadow">修改收货信息</span>
                                        </button>
                                    </div>
                                    <div class="col-sm-4">
                                        <label class="col-sm-4 control-label no-padding-right" id="seller" >卖家备注:</label>
                                        <textarea rows="2" cols="155" readonly="true" style="resize: none;"></textarea>
                                    </div>
                                </div>
                                <br>
                                <br>
                                <div class="row read">
                                    <div class="col-sm-4">
                                        <label class="col-sm-4 control-label no-padding-right">收货人姓名:</label>
                                        <input type="text" class="col-xs-6 col-sm-6 con_inf_name read" />
                                    </div>
                                    <div class="col-sm-4">
                                        <label class="col-sm-4 control-label no-padding-right" >收货人邮编:</label>
                                        <input type="text" class="col-xs-6 col-sm-6 con_inf_postcode read" />
                                    </div>
                                </div>
                                <br>
                                <br>
                                <div class="row read">
                                    <div class="col-sm-4">
                                        <label class="col-sm-4 control-label no-padding-right" >收货人邮箱:</label>
                                        <input type="text" class="col-xs-6 col-sm-6 con_inf_email read" />
                                    </div>
                                </div>
                                <br>
                                <br>
                                <div class="row read">
                                    <div class="col-sm-4">
                                        <label class="col-sm-4 control-label no-padding-right" >收货人固定电话:</label>
                                        <input type="text" class="col-xs-6 col-sm-6 con_inf_tel read" />
                                    </div>
                                </div>
                                <br>
                                <br>
                                <div class="row read">
                                    <div style="width: 100%">
                                        <div class="col-sm-3">
                                            <label class="col-sm-3 control-label no-padding-right" >收货地址:</label>
                                        </div>
                                        <div class="col-sm-4" id="radioArray">
                                            <div>
                                                <input name="form-field-radio" type="radio" class="ace read myRadio">
                                                <span class="lbl con_inf_address"></span>
                                            </div>
                                        </div>
                                        <div>
                                            <button class="btn btn-sm btn-warning read" id="showAddresButton">
                                                <i class="ace-icon"></i>
                                                <span class="bigger-110 no-text-shadow">添加地址</span>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                                <br>
                                <br>
                                <div class="row read" id="showTable">
                                    <div style="width: 100%">

                                        <div class="col-sm-2">
                                            <select class="form-control read" id="form-field-select-1">
                                                <option value="0">请选择</option>
                                            </select>
                                        </div>
                                        <div class="col-sm-2">
                                            <select class="form-control read" id="form-field-select-2">
                                                <option value="0">请选择</option>
                                            </select>
                                        </div>
                                        <div class="col-sm-2">
                                            <select class="form-control read" id="form-field-select-3">
                                                <option value="0">请选择</option>
                                            </select>
                                        </div>
                                        <div class="col-sm-5">
                                            <input type="text" class="col-xs-8 col-sm-8 read" placeholder="请输入详细地址" id="form-field-select-text" />
                                        </div>
                                        <div class="col-sm-1">
                                            <button class="btn btn-sm btn-warning read" id="addAddresButton">
                                                <i class="ace-icon"></i>
                                                <span class="bigger-110 no-text-shadow">确定</span>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                                <br>
                                <br>
                                <div class="row">
                                    <button class="btn btn-danger btn-block read" id="saveButton">保存收货信息</button>
                                </div>
                                <br>
                                <hr/>
                                <div class="row">
                                    <div style="width: 100%">
                                        <div class="col-sm-4">
                                            <label class="col-sm-4 control-label no-padding-right" >原门店编号</label>
                                            <input type="text" class="col-xs-6 col-sm-6" />
                                        </div>
                                        <div class="col-sm-4">
                                            <label class="col-sm-4 control-label no-padding-right" >原门店名称</label>
                                            <input type="text" class="col-xs-6 col-sm-6" />
                                        </div>
                                    </div>
                                    <br>
                                    <br>
                                    <br>

                                    <div style="width: 100%">
                                        <div class="col-sm-4">
                                            <label class="col-sm-4 control-label no-padding-right" >选择新门店</label>
                                            <input type="text" class="col-xs-6 col-sm-6" id="newStores" />
                                        </div>

                                        <div class="col-sm-4">
                                            <label class="col-sm-4 control-label no-padding-right" >改派原因</label>
                                            <select style="width: 120px" class="form-control" id="form-field-select-4">
                                                <option value="">请选择原因</option>
                                                <option value="AL">库存不足</option>
                                                <option value="AK">人员无法配送</option>
                                            </select>
                                        </div>

                                        <div class="col-sm-2">
                                            <button class="btn btn-xs btn-pink" id="separateBillButton">拆单</button>
                                        </div>
                                    </div>

                                    <br>
                                    <br>
                                    <br>

                                        <%--商品分单信息--%>
                                    <div id="sin_com_inf" class="tab-pane tabe1 tabe2">
                                        <h3>商品分单信息</h3>
                                        <hr/>
                                        <table id="table_sin_com_inf" class="table table-hover" style="width: 100%;">
                                            <thead>
                                            <tr>
                                                <th>商品编号</th>
                                                <th>商品名称</th>
                                                <th>商品价格</th>
                                                <th>购买数量</th>
                                                <th>门店名称</th>
                                                <th>门店编码</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                        </table>
                                    </div>

                                    <br>
                                    <br>

                                    <div class="tabe2 tabe3">
                                        <button class="btn btn-xs btn-blue" id="confirmButton">&nbsp;&nbsp;确认&nbsp;&nbsp;</button>
                                    </div>
                                    <br>

                                        <%--仓库信息--%>
                                    <div id="war_inf" class="tab-pane tabe2 tabe3">
                                        <table id="table_war_inf" class="table table-hover" style="width: 100%;">
                                            <thead>
                                            <tr>
                                                <th>选择</th>
                                                <th>门店编号</th>
                                                <th>门店名称</th>
                                                <th>能否发物流</th>
                                                <th>省</th>
                                                <th>市</th>
                                                <th>地址</th>
                                                <th>当前距离(公里)</th>
                                                <th>库存</th>
                                            </tr>
                                            </thead>
                                        </table>
                                    </div>
                                    <br>
                                    <br>
                                    <div style="float:right">
                                        <button class="btn btn-primary" id="summitOrderButton">
                                            提交订单
                                        </button>
                                        <button class="btn btn-primary">
                                            取消改派
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </div>

        <script>
            var row,    // 详情数据
                index,  // 行索引
                stateName = [],  //门店名称集合
                stateCode = [],  //门店编码集合
                judge = 1;  // 更改行(判断是否可以操作)

            $(function(){

                GetRequest();

                $("#showTable").hide();     //选择下拉框

                $(".tabe2").hide();         //隐藏拆单列表,仓库列表

                $(".read").attr({ disabled: 'true' });      //收货信息设置只读

                tableSinComInf();           //初始化分单信息列表

                $('#table_sin_com_inf tbody').on('click', 'tr', function () {
                    index = this._DT_RowIndex;
                    if ($(this).hasClass('selected')) {
                        $(this).css({'background-color': '#f9f9f9'})
                        $(this).removeClass('selected');
                    } else {
                        $("#table_sin_com_inf").dataTable().$('tr.selected').css({'background-color': '#f9f9f9'})
                        $("#table_sin_com_inf").dataTable().$('tr.selected').removeClass('selected');
                        $(this).addClass('selected');
                        $(this).css({'background-color': '#00c0ef'})
                    }
                });

                //'省'层级数据
                $.ajax({
                    url:"/dispatch/level2",
                    dataType:"JSON",
                    data:{
                        "level" : 0
                    },
                    success: function (resut) {
                        $("#form-field-select-1").empty();          //内容清空
                        $("#form-field-select-1").append("<option value='0'>请选择</option>"); //为Select追加一个Option(下拉项)
                        for (var i = 0; i < resut.length; i++) {
                            $("#form-field-select-1").append("<option value="+resut[i].id+">"+resut[i].name+"</option>");
                        }
                    }
                });


            });

            // 返回按钮(跳转回详情页面)
            $(".backButton").on("click", function () {
                window.location.href="/dispatchStoreApplications/dispatchStoreApplicationsDetails";   //跳转派单页面
            });

            // 关闭按钮(跳转派单列表页面)
            $("#closeButton").on("click", function () {
                window.location.href="/dispatchStoreApplications.do";
            });

            // 添加地址按钮(展示拆单列表,仓库列表)
            $("#showAddresButton").on("click", function () {
                $("#showTable").show();
            });

            // 拆单按钮(展示拆单列表)
            $("#separateBillButton").on("click", function () {
                $(".tabe1").show();
                $("#newStores").addClass("disabled");       //拆单后选择新门店失效

                // 存储商品信息,用作判断提交订单是否分单
                var rowss=$("#table_sin_com_inf tbody tr");
                for(var i=0;i<rowss.length;i++) { //遍历表格的行
                    for (var j = 0; j < rowss.eq(i).find("td").length; j++) {  //遍历每行的列
                        if (j == 4) {
                            stateName.push(rowss.eq(i).find("td").eq(j).html());
                        }
                        if (j == 5) {
                            stateCode.push(rowss.eq(i).find("td").eq(j).html());
                        }
                    }
                }
            });

            // '市'下拉框(点击)
            $("#form-field-select-2").on("click", function () {
                if (0 == $("#form-field-select-1").val()) {
                    layer.msg("对不起,请先选择'省'")
                }
            });

            // '县/区'下拉框(点击)
            $("#form-field-select-3").on("click", function () {
                if (0 == $("#form-field-select-2").val()) {
                    layer.msg("对不起,请先选择'市'")
                }
            });

            // '省'下拉框(改变)
            $("#form-field-select-1").on("change", function () {
                $.ajax({
                    url:"/dispatch/level2",
                    dataType:"JSON",
                    data:{
                        "level" : 1,
                        "code" : $("#form-field-select-1").val()
                    },
                    success: function (resut) {
                        $("#form-field-select-2").empty();          //内容清空
                        $("#form-field-select-2").append("<option value='0'>请选择</option>"); //为Select追加一个Option(下拉项)
                        for (var i = 0; i < resut.length; i++) {
                            $("#form-field-select-2").append("<option value="+resut[i].id+">"+resut[i].name+"</option>");
                        }
                    }
                });
            });

            // '市'下拉框(改变)
            $("#form-field-select-2").on("change", function () {
                $.ajax({
                    url:"/dispatch/level2",
                    dataType:"JSON",
                    data:{
                        "level" : 2,
                        "code" : $("#form-field-select-2").val()
                    },
                    success: function (resut) {
                        $("#form-field-select-3").empty();          //内容清空
                        $("#form-field-select-3").append("<option value='0'>请选择</option>"); //为Select追加一个Option(下拉项)
                        for (var i = 0; i < resut.length; i++) {
                            $("#form-field-select-3").append("<option value="+resut[i].id+">"+resut[i].name+"</option>");
                        }
                    }
                });
            });

            // 确认按钮(修改配送门店)
            $("#confirmButton").on("click", function () {
                cleartd(parseInt($('input:radio:checked').val()) + 1);
            })

            var spanid = 0;
            // 添加收货地址按钮(添加收货地址)
            $("#addAddresButton").on("click", function () {
                var privice = $("#form-field-select-1").find("option:selected").text();
                var city = $("#form-field-select-2").find("option:selected").text();
                var county = $("#form-field-select-3").find("option:selected").text();
                var addres = $("#form-field-select-text").val();
                if ("请选择" == county || "" == addres) {
                    layer.msg("新的收货地址'省市区','地址详情'不能为空");
                    return
                }
                spanid++;
                var ss = "span" + spanid;
                var addr = privice + city + county + addres;
                $("#radioArray").append("<div><input name=\"form-field-radio\" checked=\"true\" value="+spanid+" type=\"radio\" class=\"ace\"><span id=\""+ss+"\" class=\"lbl con_inf_address\">"+addr+"</span></div>");

            })

            // 修改收货信息按钮(移除只读属性)
            $("#updateButton").on("click", function () {
                $(".read").removeAttr("disabled"); //去除readonly属性
            })

            // 保存按钮(保存收货信息)
            $("#saveButton").on("click", function () {
                var code = sessionStorage.getItem('dispatchCode'); //订单编码
                //
                var $radio = $('input[name=form-field-radio]:checked')//被选中的单选框
                var cc = "span" + $radio.val();
                var addess = $("#"+cc).html();
                $.ajax({
                    url:"/dispatch/changeConsigneeInfo",
                    type:"POST",
                    data:{
                        "code" : code,                                      //订单编码
                        "consigneeName" : $(".con_inf_name").val(),         //收货人名字
                        "postcode" : $(".con_inf_postcode").val(),          //收货人邮编
                        "email" : $(".con_inf_email").val(),                //收货人邮箱
                        "consigneeMobile" : $(".con_inf_tel").val(),        //收货人电话
                        "provinceId" : $("#form-field-select-1").val(),     //省id
                        "cityId" : $("#form-field-select-2").val(),         //市id
                        "districtId" : $("#form-field-select-3").val(),     //区id
                        "provinceText" : $("#form-field-select-1").find("option:selected").text(),  //省名字
                        "cityText" : $("#form-field-select-2").find("option:selected").text(),      //市名字
                        "districtText" : $("#form-field-select-3").find("option:selected").text(),  //区名字
                        "address" : addess                                  //详细地址
                    },
                    success: function (resut) {
                        window.location.href="/dispatch/reassignment";
                    }
                });
            })

            // 提交订单按钮(拆单信息提交)
            $("#summitOrderButton").on("click", function () {
                var rowss=$("#table_sin_com_inf tbody tr");
                var LOGO1 = 0;
                var itemIds = [];               //商品编码集合
                var quantities = [];            //购买数量集合
                var targetDepotCodes = [];      //门店编码集合

                if (rowss.length == stateName.length) {
                    err:
                        for (var i = 0; i < rowss.length; i++) { //遍历表格的行
                            for (var j = 0; j < rowss.eq(i).find("td").length; j++) {  //遍历每行的列
                                if (j == 4) {
                                    if (rowss.eq(i).find("td").eq(j).html() != stateName[i]) {
                                        LOGO1 = 1;
                                        break err;
                                    }
                                }
                                if (j == 5) {
                                    if (rowss.eq(i).find("td").eq(j).html() != stateCode[i]) {
                                        LOGO1 = 1;
                                        break err;
                                    }
                                    targetDepotCodes.push(rowss.eq(i).find("td").eq(5).html());
                                }
                            }
                        }

                    for (var i = 0; i < rowss.length; i++) { //遍历表格的行
                        for (var j = 0; j < rowss.eq(i).find("td").length; j++) {  //遍历每行的列
                            if (j == 0) {
                                itemIds.push(rowss.eq(i).find("td").eq(0).html());
                            }
                            if (j == 3) {
                                var jk = rowss.eq(i).find("td").eq(3).html();
                                jk = jk.substring(0,2);
                                quantities.push(parseInt(jk));
                            }
                            if (j == 5) {
                                console.log("5_____________"+rowss.eq(i).find("td").eq(j).html() != stateCode[i]);
                                targetDepotCodes.push(rowss.eq(i).find("td").eq(5).html());
                            }
                        }
                    }
                } else {
                    LOGO1 = 1;
                }

                // LOGO1等于零 派单 LOGO1等于一 拆单
                if (LOGO1 == 0) {
                    var code = sessionStorage.getItem('dispatchCode'); //订单编码
                    $.ajax({
                        url:"/dispatch/dispatching",
                        type:"POST",
                        data:{
                            "code" : code,
                            "targetDepotCode" : $("#newStores").val()
                        },
                        success: function (resut) {
                        }
                    });
                } else {
                    var code = sessionStorage.getItem('dispatchCode'); //订单编码
                    var array = [];
                    for (var dj = 0; dj < itemIds.length; dj++) {
                        var objStr = "{\"itemId\":"+itemIds[dj]+",\"quantity\":"+quantities[dj]+",\"targetDepotCode\":\""+targetDepotCodes[dj]+"\"}";
                        console.log(objStr);
                        var obj = JSON.parse(objStr);
                        array.push(obj);
                    }
                    $.ajax({
                        url:"/dispatch/orderSplit",
                        type:"POST",
                        data:{
                            "orderCode" : code,
                            "splitItems" : JSON.stringify(array),
                            "splitRemark" : ""
                        },
                        success: function (resut) {
                        }
                    });
                }
            })

            function cleartd(k) {
                var tab=document.getElementById("table_war_inf");
                var rows=tab.rows;
                var name;
                var code;

                for(var i=0;i<rows.length;i++) { //遍历表格的行
                    if (k == i) {
                        for (var j = 0; j < rows[i].cells.length; j++) {  //遍历每行的列
                            if (j == 1) {
                                code = rows[i].cells[j].innerHTML;
                            }
                            if (j == 2) {
                                name = rows[i].cells[j].innerHTML;
                            }
                        }
                    }
                }

                var rowss=$("#table_sin_com_inf tbody tr");

                for(var i=0;i<rowss.length;i++) { //遍历表格的行
                    if (judge == i) {
                        for (var j = 0; j < rowss.eq(i).find("td").length; j++) {  //遍历每行的列
                            if (j == 4) {
                                rowss.eq(i).find("td").eq(j).html(name);
                            }
                            if (j == 5) {
                                rowss.eq(i).find("td").eq(j).html(code);
                            }
                        }
                    }
                }
            }

            // 更改按钮(仓库列表)
            function alterButton(ji) {
                judge = ji;                 //保存这次修改行
                $(".tabe3").show();

                $.ajax({
                    url:"/dispatch/getNearMeetStockDepots",
                    dataType:"JSON",
                    type:"POST",
                    data:{
                        "lat" : "165.156",
                        "lon" : "18.156",
                        "productCode" : "c",
                        "quantity" : 12
                    },
                    success: function (resut) {
                        var jArray = []
                        for (var i = 0; i < resut.length; i++) {
                            var array = [];
                            array.push("<input name=\"sex\" value="+i+" type=\"radio\" class=\"myRadio\">");
                            array.push(resut[i].depotCode);
                            array.push(resut[i].depotName);
                            array.push(resut[i].enableExpress);
                            array.push("测试四川省");
                            array.push("测试四川省会");
                            array.push(resut[i].detailAddress);
                            array.push(resut[i].distance);
                            array.push("缺少库存数");
                            jArray.push(array);
                        }
                        $("#table_war_inf").dataTable({
                            searching: false,
                            ordering: false,
                            paging: false, // 禁止分页
                            bDestory: true,
                            bRetrieve: true,
                            data: jArray,
                        });
                    }
                });
            }

            // 获取session 存储的值
            function GetRequest() {
                var vc = sessionStorage.getItem('sendOperation'); // => 返回testKey对应的值
                if (vc != null) {
                    row = JSON.parse(vc)
                    con_inf_value(row.consignee);
                }
            }

            // 获取商品分单信息列表
            function tableSinComInf() {
                var obj = tableSinComInfCov();
                var table = $("#table_sin_com_inf").dataTable({
                    searching: false,
                    ordering: false,
                    paging: false, // 禁止分页
                    bDestory: true,
                    bRetrieve: true,
                    data: obj,
                });
            }

            // 商品分单信息 封装
            function tableSinComInfCov() {
                var arr = [];
                var ty = [];
                if (row != null) {
                    arr.push(row.code);
                    arr.push(row.orderSource);
                    arr.push(row.posNo);
                    arr.push(row.amount + '&nbsp;&nbsp;&nbsp;' + '<button class=\'btn btn-xs btn-pink\' onclick=\'addLine()\'>十</button>');
                    arr.push(row.posNo);
                    arr.push(row.posNo);
                    arr.push("<button class=\"btn btn-xs btn-pink\" onclick='alterButton()'>更改</button>");
                    ty.push(arr);
                }

                arr.push("1234556");
                arr.push("来源数据");
                arr.push("假数据123");
                arr.push(12 + '&nbsp;&nbsp;&nbsp;' + '<button class=\'btn btn-xs btn-pink\' onclick=\'addLine()\'>十</button>');
                arr.push("假门店名称123");
                arr.push("假门店编码123");
                arr.push("<button class=\"btn btn-xs btn-pink\" onclick='alterButton(0)'>更改</button>");
                ty.push(arr);
                return ty;
            }

            var ji = 0;
            // 商品分单信息列表添加行
            function addLine() {
                var dt = $("#table_sin_com_inf").dataTable();
                var num = dt.api().rows().count();    // 行号
                ji++;
                var arr = [];
                if (row != null) {
                    arr.push(ji);
                    arr.push(row.orderSource);
                    arr.push(row.posNo);
                    arr.push(row.amount + '&nbsp;&nbsp;&nbsp;' + '<button class=\'btn btn-xs btn-pink\' onclick=\'addLine()\'>十</button>' + '&nbsp;&nbsp;&nbsp;' + '<button class=\'btn btn-xs btn-pink\' onclick=\'cutLine(' + num + ')\'>一</button>');
                    arr.push(row.posNo);
                    arr.push("<button class=\"btn btn-xs btn-pink\" onclick='alterButton("+ji+")'>更改</button>");
                }

                arr.push(ji);
                arr.push("测试来源1");
                arr.push("测试来源1");
                arr.push(22 + '&nbsp;&nbsp;&nbsp;' + '<button class=\'btn btn-xs btn-pink\' onclick=\'addLine()\'>十</button>' + '&nbsp;&nbsp;&nbsp;' + '<button class=\'btn btn-xs btn-pink\' onclick=\'cutLine(' + num + ')\'>一</button>');
                arr.push("测试来源1");
                arr.push("<button class=\"btn btn-xs btn-pink\" onclick='alterButton("+ji+")'>更改</button>");
                dt.api().row.add(arr).draw();

            }

            // 删除行
            function cutLine(num) {
                var dt = $("#table_sin_com_inf").dataTable().api();
                if (num != 0) {
                    if (index == num) {
                        dt.row('.selected').remove().draw(false);
                    } else {
                        layer.msg("选中行与删除行不一致");
                    }
                }
            }

            // 收货人信息赋值
            function con_inf_value(consignee) {
                console.log(consignee)
                if (consignee != null) {
                    $("#seller").val(consignee.modifyRemark);
                    $(".con_inf_name").val(consignee.consigneeName);
//                    $(".con_inf_postcode").val(consignee.consigneeMobile); //暂缺 邮编
//                    $(".con_inf_email").val(consignee.consigneeMobile);    //暂缺 邮箱
                    $(".con_inf_tel").val(consignee.consigneeMobile);
                    $(".con_inf_address").html(consignee.address);
                }
            }

        </script>
    </jsp:body>
</primus:page>